import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-09-22
 * Time: 8:41
 */

//P115第二题
public class matrix {
    public static void main(String[] args) {
        int i,j,t = 0;
        int[] a = new int[6];
        Scanner scanner = new Scanner(System.in);
        System.out.print("Input 6 integer number:");  //输入6个整数
        for (i = 0; i < 6; i++) {
            a[i] = scanner.nextInt();
        }
        System.out.println();
        for (i = 0; i < 6; i++) {
            for (j = 0; j < 6; j++) {
                System.out.print(a[j]+" ");
            }
            t = a[5];
//          将元素循环右移
            for (j = 5; j > 0; j--) {
                a[j] = a[j-1];
            }
            a[0] = t;
            System.out.println();
        }
    }
}
